using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace NeuroSpeech.Imap
{
	public class ImapResponseSearch : BaseImapResponse
	{
		public ulong[] IDs { get; set; }

		#region public override void  Process(ImapClient client)
		public override void Process(ImapClient client)
		{
			base.Process(client);

			string line = Lines.FirstOrDefault();
			if (string.IsNullOrWhiteSpace(line))
				return;

			string[] tokens = line.Split();

			List<ulong> list = new List<ulong>();

			foreach (var item in tokens.Skip(2))
			{
				ulong i = 0;
				if (ulong.TryParse(item, out i)) {
					list.Add(i);
				}
			}

			IDs = list.ToArray();
		}
		#endregion

	}
}
